using System;
using System.ComponentModel.DataAnnotations;

namespace BW.WMS.WCL.DTO
{
    /// <summary>
    /// 创建库存DTO
    /// </summary>
    public class CreateInventoryDto
    {
        /// <summary>
        /// 仓库编码
        /// </summary>
        [Required(ErrorMessage = "仓库编码不能为空")]
        public string WarehouseId { get; set; }

        /// <summary>
        /// 库位编码
        /// </summary>
        [Required(ErrorMessage = "库位编码不能为空")]
        public string LibraryLocationId { get; set; }

        /// <summary>
        /// 项目编码
        /// </summary>
        [Required(ErrorMessage = "项目编码不能为空")]
        public string ItemId { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        [Required(ErrorMessage = "数量不能为空")]
        [Range(0, double.MaxValue, ErrorMessage = "数量必须大于等于0")]
        public decimal Quantity { get; set; }

        /// <summary>
        /// 批号
        /// </summary>
        public string BatchCode { get; set; }

        /// <summary>
        /// 效期
        /// </summary>
        public DateTime? InvalidDate { get; set; }

        /// <summary>
        /// 上限
        /// </summary>
        [Range(0, double.MaxValue, ErrorMessage = "上限必须大于等于0")]
        public decimal? Up { get; set; }

        /// <summary>
        /// 下限
        /// </summary>
        [Range(0, double.MaxValue, ErrorMessage = "下限必须大于等于0")]
        public decimal? Down { get; set; }
    }

    /// <summary>
    /// 更新库存DTO
    /// </summary>
    public class UpdateInventoryDto
    {
        /// <summary>
        /// 库存记录ID
        /// </summary>
        [Required(ErrorMessage = "库存记录ID不能为空")]
        public Guid Id { get; set; }

        /// <summary>
        /// 仓库编码
        /// </summary>
        [Required(ErrorMessage = "仓库编码不能为空")]
        public string WarehouseId { get; set; }

        /// <summary>
        /// 库位编码
        /// </summary>
        [Required(ErrorMessage = "库位编码不能为空")]
        public string LibraryLocationId { get; set; }

        /// <summary>
        /// 项目编码
        /// </summary>
        [Required(ErrorMessage = "项目编码不能为空")]
        public string ItemId { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        [Required(ErrorMessage = "数量不能为空")]
        [Range(0, double.MaxValue, ErrorMessage = "数量必须大于等于0")]
        public decimal Quantity { get; set; }

        /// <summary>
        /// 批号
        /// </summary>
        public string BatchCode { get; set; }

        /// <summary>
        /// 效期
        /// </summary>
        public DateTime? InvalidDate { get; set; }

        /// <summary>
        /// 上限
        /// </summary>
        [Range(0, double.MaxValue, ErrorMessage = "上限必须大于等于0")]
        public decimal? Up { get; set; }

        /// <summary>
        /// 下限
        /// </summary>
        [Range(0, double.MaxValue, ErrorMessage = "下限必须大于等于0")]
        public decimal? Down { get; set; }
    }

    /// <summary>
    /// 删除库存DTO
    /// </summary>
    public class DeleteInventoryDto
    {
        /// <summary>
        /// 库存记录ID
        /// </summary>
        [Required(ErrorMessage = "库存记录ID不能为空")]
        public Guid Id { get; set; }
    }
} 